package com.sandwich.admin.domain.repository;


import com.sandwich.admin.domain.ContentSummaryEntity;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;

/**
 * @description 简介信息
 * @date 2021-07-28
 */
public interface ContentSummaryRepository extends PagingAndSortingRepository<ContentSummaryEntity, Long> {
    @Query(value = "select cs.* from category_content_summary ccs left join content_summary cs on ccs.content_summary_pk = cs.pk " +
            "where ccs.status =0 and ccs.category_pk =?1 ", nativeQuery = true)
    Page<ContentSummaryEntity> findPageCategoryByCategoryPk(long categoryPk, Pageable pageable);

    Page<ContentSummaryEntity> findAll(Pageable pageable);

}